import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * @Author YuanYuan
 * @Date 2022/5/7
 * @Time 9:37
 */
public class TestDemo {
    public static int[] twoSum(int[] arr,int target) {
        Map<Integer,Integer> hashtable = new HashMap<Integer,Integer>();
        for (int i = 0; i < arr.length; i++) {
            if(hashtable.containsKey(target-arr[i])) {
                return new int[]{hashtable.get(target-arr[i]),i};
            }
            hashtable.put(arr[i],i);
        }
        return new int[0];
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine().toString();
        String[] str1 = str.split(" ");
        int[] arr = new int[str1.length];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = Integer.parseInt(str1[i]);
        }
        int target = scanner.nextInt();
        System.out.println(Arrays.toString(twoSum(arr,target)));
    }
}
